//
//  RootViewController.m
//  IMZone人
//
//  Created by summer on 15/8/5.
//  Copyright (c) 2015年 summer. All rights reserved.
//

#import "RootViewController.h"
#import "ChatListViewController.h"
#import "RCDChatViewController.h"
@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    UIButton * callBtn = [UIButton buttonWithType:UIButtonTypeSystem];
    callBtn.backgroundColor = [UIColor redColor];
    [callBtn setTintColor:[UIColor whiteColor]];
    [callBtn setTitle:@"聊天" forState:UIControlStateNormal];
    [callBtn addTarget:self action:@selector(call) forControlEvents:UIControlEventTouchUpInside];
    callBtn.frame = (CGRect){100 , 200 , 120 , 40};
    [self.view addSubview:callBtn];
}

- (void)call
{
//    ChatListViewController * chatVC = [ChatListViewController new];
//    [self.navigationController pushViewController:chatVC animated:YES];
    
    RCConversationModel * model = [RCConversationModel new];
    model.conversationType = 1;
    model.targetId = @"ww1";
    model.conversationTitle = @"summer"; //会话名称
     RCDChatViewController *_conversationVC = [[RCDChatViewController alloc]init];
    _conversationVC.conversationType = 1;
    _conversationVC.targetId = @"ww1";
    _conversationVC.userName = @"summer";
    _conversationVC.title = @"summer";
    _conversationVC.conversation = model;
    _conversationVC.hidesBottomBarWhenPushed    = YES;
    
    [self.navigationController pushViewController:_conversationVC animated:YES];
    
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
